package com.ruoyi.blog.controller;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.domain.AjaxResult;

/**
 * 站点信息公开接口（博客）。
 */
@RestController
@RequestMapping("/blog/site")
public class BlogSiteController {

    /**
     * 获取站点信息（无需登录）。
     */
    @Anonymous
    @GetMapping("/info")
    public AjaxResult getSiteInfo() {
        Map<String, Object> data = new HashMap<>();
        data.put("heroTitle", "Arcanum Knowledge Hub");
        data.put("heroSubtitle", "Curated insights, engineering notes, and patterns");
        data.put("heroDescription", "Exploring software craftsmanship, systems thinking, and pragmatic design.");
        data.put("ctaText", "Explore Articles");
        data.put("ctaLink", "/articles");
        data.put("secondaryCtaText", "About Arcanum");
        data.put("secondaryCtaLink", "/about");
        data.put("contactEmail", "hello@arcanum.example.com");

        data.put("featuredCategoryIds", List.of());
        data.put("showcaseTagIds", List.of());

        List<Map<String, String>> timeline = new ArrayList<>();
        Map<String, String> t1 = new HashMap<>();
        t1.put("year", "2023");
        t1.put("title", "Arcanum Theme Born");
        t1.put("description", "Initial design tokens and utility presets defined.");
        timeline.add(t1);
        Map<String, String> t2 = new HashMap<>();
        t2.put("year", "2024");
        t2.put("title", "Vitesse Integration");
        t2.put("description", "Ported theme and components to Vitesse + UnoCSS.");
        timeline.add(t2);
        data.put("timeline", timeline);

        List<Map<String, String>> principles = new ArrayList<>();
        Map<String, String> p1 = new HashMap<>();
        p1.put("title", "Pragmatism");
        p1.put("description", "Favor clarity, reliability, and maintainability.");
        principles.add(p1);
        Map<String, String> p2 = new HashMap<>();
        p2.put("title", "Consistency");
        p2.put("description", "Use shared tokens and helpers across the stack.");
        principles.add(p2);
        data.put("principles", principles);

        return AjaxResult.success(data);
    }
}